From 509fb41174d61f3b60d9dbae680fccd048744268 Mon Sep 17 00:00:00 2001 From: "cl349@freefall.cl.cam.ac.uk" Date: Fri, 3 Sep 2004 10:56:28 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.122 (41384ddcEDLEgoHoCYQuvXnUiQgwcw) Allow loading other images besides Linux images. --- tools/libxc/xc_linux_build.c | 14 +++++++++++--- xen/common/elf.c | 13 ++++++++++--- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/tools/libxc/xc_linux_build.c b/tools/libxc/xc_linux_build.c index 41569b8057..ea504c12e8 100644 --- a/tools/libxc/xc_linux_build.c +++ b/tools/libxc/xc_linux_build.c @@ -600,10 +600,18 @@ static int parseelfimage(char *elfbase, guestinfo = elfbase + shdr->sh_offset; - if ( (strstr(guestinfo, "GUEST_OS=linux") == NULL) || - (strstr(guestinfo, "XEN_VER=2.0") == NULL) ) + if ( (strstr(guestinfo, "LOADER=generic") == NULL) && + (strstr(guestinfo, "GUEST_OS=linux") == NULL) ) { - ERROR("Will only load Linux images built for Xen v2.0"); + ERROR("Will only load images built for the generic loader " + "or Linux images"); + ERROR("Actually saw: '%s'", guestinfo); + return -EINVAL; + } + + if ( (strstr(guestinfo, "XEN_VER=2.0") == NULL) ) + { + ERROR("Will only load images built for Xen v2.0"); ERROR("Actually saw: '%s'", guestinfo); return -EINVAL; } diff --git a/xen/common/elf.c b/xen/common/elf.c index 1d8384e3bd..ae20c04f6f 100644 --- a/xen/common/elf.c +++ b/xen/common/elf.c @@ -68,10 +68,17 @@ int parseelfimage(char *elfbase, guestinfo = elfbase + shdr->sh_offset; printk("Xen-ELF header found: '%s'\n", guestinfo); - if ( (strstr(guestinfo, "GUEST_OS=linux") == NULL) || - (strstr(guestinfo, "XEN_VER=2.0") == NULL) ) + if ( (strstr(guestinfo, "LOADER=generic") == NULL) && + (strstr(guestinfo, "GUEST_OS=linux") == NULL) ) { - printk("ERROR: Xen will only load Linux built for Xen v2.0\n"); + printk("ERROR: Xen will only load images built for the generic " + "loader or Linux images\n"); + return -EINVAL; + } + + if ( (strstr(guestinfo, "XEN_VER=2.0") == NULL) ) + { + printk("ERROR: Xen will only load images built for Xen v2.0\n"); return -EINVAL; } -- 2.30.2